a = int(input("请输入a的值："))
n=0
while a>1:
    if a % 2 == 0:
        a = a / 2
        print("a=",a)
        n = n + 1
        print("改变了", n, "次")
    else:
        a = a * 3 + 1
        print("a=",a)
        n = n + 1
        print("改变了", n, "次")
    if a == 1:
        break



